{include file="common/head"/}
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>短信配置-聚合数据</legend>
    </fieldset>
    <form class="layui-form layui-form-pane"> 
		 <div class="layui-form-item">
            <label class="layui-form-label">短信服务商</label>
            <div class="layui-input-4">
                <input type="text" lay-verify="required"  id="sms_appkey"  name="sms_appkey" placeholder="短信服务商名称" value="{$info.sms_appkey}" class="layui-input">
            </div>
        </div> 
		<div class="layui-form-item">
            <label class="layui-form-label">服务URL</label>
            <div class="layui-input-4">
                <input type="text" lay-verify="required"  id="sms_url"  name="sms_url" placeholder="短信服务商链接" value="{$info.sms_url}" class="layui-input">
            </div>
        </div>   
        <div class="layui-form-item">
            <label class="layui-form-label">通信秘钥</label>
            <div class="layui-input-3">
                <input type="text" name="sms_secretKey"  id="sms_secretKey" lay-verify="required" placeholder="secretKey验证" value="{$info.sms_secretKey}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">验证模板</label>
            <div class="layui-input-3">
                <input type="text" name="sms_product"  id="sms_product" lay-verify="required" placeholder="验证模板" value="{$info.sms_product}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">测试手机</label>
            <div class="layui-input-3">
                <input type="text" name="test_hone" id="test_hone" placeholder="测试接收手机号" value="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>  
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$= layui.jquery; 
        //提交监听
        form.on('submit(submit)', function (data) {
            loading =layer.load(1, {shade: [0.1,'#fff']});
            $.post("{:url('system/sms')}",data.field,function(res){
                layer.close(loading);
                if(res.code > 0){
                    layer.msg(res.msg,{icon: 1, time: 1000},function(){
                        location.href = res.url;
                    });
                }else{
                    layer.msg(res.msg,{icon: 2, time: 1000});
                }
            });
        })
    })
</script>
</body>
</html>